<template>
  <div class="GameInfo">
    <img src="../../assets/imgs/bg.png" alt="background" class="bgCls" />
    <section>
      <p class="title">{{ info.title }}</p>
      <div class="main">
        <div class="desc">
          <p
            class="descItem"
            v-for="(descItem, index) in info?.desc"
            :key="index"
          >
            {{ descItem }}
          </p>
        </div>
        <p class="content">
          <div
          class="contentItem"
          v-for="(Citem, index) in info?.content"
          :key="index"
        >
        <p class="Ctitle">{{ Citem.title }}</p>
        <p class="Cdesc" v-for="(Celement,location) in Citem.desc">{{ Celement }}</p>
        <template v-if="Citem.picture">
          <img v-if="Citem.picture == '2-4'" src="../../assets/imgs/2-4.png" alt="">
          <img v-else-if="Citem.picture == '2-5'" src="../../assets/imgs/2-5.png" alt="">
        </template>
       
      </div>
        </p>
      </div>
    </section>
  </div>
</template>

<script setup lang="ts">
import gameInfo from "../../assets/info/info";
import { useRoute } from "vue-router";
import { ref } from "vue";
const route = useRoute();
const info = ref<any>("");
const getInfo = () => {
  let father = route.query?.father;
  let child = route.query?.child;
  gameInfo.map((item: any, index: number) => {
    if (item.father == father && item.child == child) {
      info.value = item;
    }
  });
};
getInfo();
</script>

<style lang="less" scoped>
.GameInfo {
  height: 100%;
  position: relative;
  .bgCls {
    position: absolute;
    width: 100%;
    height: 100%;
  }
  section {
    overflow-y: scroll;
    position: absolute;
    top: 143px;
    left: 30px;
    right: 30px;
    bottom: 50px;
    color: #fff;

    .title {
      text-align: center;
      font-size: 40px;
      font-weight: bold;
    }
    .desc {
      line-height: 1.5;
      margin-top: 20px;
      color: #eeeceb;
    }
    .content {
      line-height: 1.5;
      .contentItem {
        margin-top: 20px;
        color: #eeeceb;
        .Ctitle {
          color: #fff;
          font-size: 28px;
          font-weight: bold;
          margin-bottom: 10px;
        }
      }
    }
  }
  section::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}
</style>
